package asteroids.statement;

import asteroids.*;
import asteroids.model.programs.*;

public abstract class Statement {

	protected int stateNumber;
	protected StatementType type;
	protected boolean finished;
	protected boolean breaker = false;
	
	public void incrementStateNumber() {
		stateNumber = stateNumber+1;
	}

	public enum StatementType {
		WHILE, FOREACH, IFELSE, PRINT, SEQ, ACTION, ASSIGN
	}

	public abstract void execute(Program program);

	public abstract int getSize();

	public boolean isFinished() {
		return this.finished;
	}

	public void loop() {
		this.finished = false;
		this.stateNumber = 0;

	}

	public StatementType getType() {
		return this.type;
	}

	public int getStateNumber() {
		return this.stateNumber;
	}
	
	public boolean getBreaker() {
		return this.breaker;
	}

	public void setBreaker(boolean newBreaker) {
		this.breaker = newBreaker;
	}

}
